package com.zzx.threekingdom.model;

import java.util.ArrayList;

import com.zzx.threekingdom.activity.PlayActivity;
import com.zzx.threekingdom.activity.PlayActivity.DisplayMode;
import com.zzx.threekingdom.card.Card;
import com.zzx.threekingdom.card.CardList;
import com.zzx.threekingdom.judge.Judge.IAskYesNo;
import com.zzx.threekingdom.judge.Judge.IPassAction;
import com.zzx.threekingdom.judge.Judge.IPassCard;
import com.zzx.threekingdom.judge.Judge.IPassCards;



public class UserPlayerModel extends AbsPlayerModel
{
    public PlayActivity playActivity;
    
    public UserPlayerModel(PlayActivity p)
    {
        super(p.mPlayerView);
        playActivity = p;
    }
    public void pickOneCharacter(CardList characterCards, IPassCard i) { playActivity.pickOneCharacter(characterCards, i); }
    public void pickTargetOneCard(ArrayList<CardList> cardss, IPassCard i) { playActivity.pickOneCard(cardss, i); }
    public void selectAbondonCards(int num, IPassCards i) { playActivity.selectAbondonCards(num, i); }
    public void onActiveUseCards() { playActivity.setDisplayMode(DisplayMode.InturnActiveUseCard); }
    public void onOutOfTurn() { playActivity.setDisplayMode(DisplayMode.CanDoNothing); }
    public void onNeedActionByName(String name, IPassCard ipc, IPassAction ipa, ActionInfo askInfo) { playActivity.selectCardByname(name, ipc); }
    public void askYesNo(String ask, IAskYesNo ia)
	{
    	onHintText(ask);
    		
    	playActivity.setAskYesNoDisplayMode(ia);
	}
    @Override
    public void addHandCards(CardList playCards)
    {
        super.addHandCards(playCards);
        playActivity.onReceiveCards(playCards);
    }
    
    @Override
    public boolean drawCard(Card card)
    {
        boolean bRet = super.drawCard(card);
        playActivity.onRemoveCard(card);
        return bRet;
    }
    
    @Override
    public boolean drawHandCards(CardList playCards)
    {
        boolean bRet = super.drawHandCards(playCards);
        playActivity.onRemoveCards(playCards);
        return bRet;
    }
    
    @Override
    public void setWaitingActiveUseDone(boolean done)
    {
        super.setWaitingActiveUseDone(done);
        if(done==true)
            playActivity.setDisplayMode(DisplayMode.CanDoNothing);
        else
            playActivity.setDisplayMode(DisplayMode.InturnActiveUseCard);
    }
    
    @Override
    public void onHintText(String hint)
    {
        playActivity.setHintText(hint);
    }
    
    @Override
    public void setStayWell() 
    {
        super.setStayWell();
        playActivity.setDisplayMode(DisplayMode.CanDoNothing);
    }
    



}
